package it.traveldreamClient.beans.dto;

import java.util.LinkedList;
import java.util.List;

import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.NotEmpty;

public class UserDTO {
	
	
	@Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?",
            message="invalid email")
	private String email;
	
	@NotEmpty
    private String nome;
	
	@NotEmpty
    private String cognome;
	
	@NotEmpty
    private String password;
	
	private List<ComponenteDTO> giftList;
	
	private List<ProdottoAcquistabileDTO> acquisti;
	
	public UserDTO (UserDTO copy){
		email=copy.getEmail();
		nome=copy.getNome();
		cognome=copy.getCognome();
		password=copy.getPassword();
		giftList=copy.getGiftList();
		acquisti=copy.getAcquisti();
	}
	
	public UserDTO(){
		acquisti=new LinkedList<ProdottoAcquistabileDTO>();
		giftList=new LinkedList<ComponenteDTO>();
	}
	public List<ComponenteDTO> getGiftList() {
		return giftList;
	}

	public void setGiftList(List<ComponenteDTO> giftList) {
		this.giftList = giftList;
	}

	public List<ProdottoAcquistabileDTO> getAcquisti() {
		return acquisti;
	}

	public void setAcquisti(List<ProdottoAcquistabileDTO> acquisti) {
		this.acquisti = acquisti;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public String getCognome() {
		return cognome;
	}

	public void setCognome(String cognome) {
		this.cognome = cognome;
	}
  
    public String getEmail() {
        return email;
    } 
 
    public void setEmail(String email) {
        this.email = email;
    }
  
    public String getPassword() {
        return password;
    }
     
    public void setPassword(String password) {
        this.password = password;
    }

	@Override
	public String toString() {
		return "UserDTO [email=" + email + ", nome=" + nome + ", cognome="
				+ cognome + ", password=" + password + ", giftList=" + giftList
				+ ", acquisti=" + acquisti + "]";
	}
     

}

